<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script src="https://unpkg.com/lodash@4.17.20/lodash.min.js"></script>
<script src="https://unpkg.com/vue@next"></script>
<div id="app">
    <save-button></save-button>
</div>
<script>
    const vueOpt = {
        data(){
            return {}
        }
    }

    const app = Vue.createApp(vueOpt);
    app.component('save-button', {
        created(){
            this.debouncedClick = _.debounce(this.click, 500);
        },
        unmounted(){
            this.debouncedClick.cancel();
        },
        methods: {
            click(){
                console.log('--data');
            }
        },
        template:`<button @click="debouncedClick">Save</button>`
    });

    app.mount('#app')

</script>
</body>
</html>
